package com.atguigu08.constructor;

/**
 * ClassName: person
 * Description:
 *
 * @Author liu
 * @Create 2024/8/27 14:12
 * @Version 1.0
 */
class person {
    //属性
    String name;
    int age;

    //构造器,可以构成重载
    public person(){
        System.out.println("person().....");
    }
    public person(int a){
        age = a;
    }
    public person(String n){
        name = n;
    }
    public person(String n,int a){
        name = n;
        age = a;
        
    }

    //方法
public void getinfo(){
    System.out.println("name "+name+",age "+age);
}

}
